package com.zqh.cli.command;
import cn.hutool.core.bean.BeanUtil;
import com.zqh.generator.file.FileGenerator;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import picocli.CommandLine.*;

import java.util.concurrent.Callable;

@Command(name = "generate",mixinStandardHelpOptions = true,description = "生成代码")
@AllArgsConstructor
@NoArgsConstructor
@Data
public class GenerateCommand implements Callable<Integer> {

    @Option(names = {"-l","--loop"},arity = "0..1",description = "是否循环",interactive = true,echo = true)
    private boolean loop;
    @Option(names = {"-GenerateCommand.java.ftl","--author"},arity = "0..1",description = "作者注释",
            interactive = true,echo = true)
    private String author;

    @Option(names = {"-o","--outputText"},arity = "0..1",description = "输出信息",
            interactive = true,echo = true)
    private String outputText;


    @Override
    public Integer call() throws Exception {

//        DataModel dataModel = new DataModel();
//        BeanUtil.copyProperties(this, dataModel);
//        System.out.println(this.loop);
//        System.out.println(dataModel.getAuthor());
//        System.out.println("配置信息：" + dataModel);
//        FileGenerator.doGenerate(dataModel);
        return 0;
    }

}
